<cfcomponent output="false">

<!--- Application settings --->
<cfset this.name = "atonement-contactmanager" />
<cfset this.sessionManagement = true>
<cfset this.sessionTimeout = createTimeSpan(0,0,30,0)>
<cfset this.ormEnabled = true>
<cfset this.datasource = "atonementContactManager">
<cfset ormPaths = [expandPath("/com/firemoss/atonement/example/contactmanager/model")]>
<cfset this.ormSettings = {
	cfclocation=ormPaths,
	logsql=true,
	flushAtRequestEnd=false,
	dbCreate="update",
	eventhandling=true,
	eventHandler="com.firemoss.atonement.coldfusion.orm.AtonementColdFusionORMEventHandler"
}>

<cffunction name="onRequestStart" output="false" access="public" returntype="any" hint="">
	<cfif structKeyExists(url,"ormreload")>
		<cfset ormReload() />
		<cfset ormClearSession() />
	</cfif>
	
	<cfif not structKeyExists( application, "beanFactory") or structKeyExists( url, "beansreload") or true>
		<cfset createBeanFactory() />
	</cfif>
</cffunction>


<cffunction name="createBeanFactory" output="false" access="private">
	<cfset var path = expandPath("/com/firemoss/atonement/example/contactmanager/service/config/ColdSpring.xml") />
	<cfset application.beanFactory = createObject( "component", "coldspring.beans.DefaultXmlBeanFactory").init() />
	<cfset application.beanFactory.loadBeans( path ) />
</cffunction>	
	
</cfcomponent>